package training.minggu5.maven.ui.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class InsertBarang extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html");
        String out = "<h1>insert barang<h1>";
        out += "<form action='simpanBarang' method='post'>";
        out += "<table><tr><td>kode barang</td>";
        out += "<td><input type='text' name='kode'/></td></tr>";
        out += "<tr><td>nama barang</td>";
        out += "<td><input type='text' name='nama'/></td></tr>";
        out += "<tr><td>unit price</td>";
        out += "<td><input type='text' name='unitprice'/></td></tr>";
        out += "<tr><td><input type='submit' value='simpan'/></td>";
        out += "<td><input type='button' value='cancel' on_click='history.back()'/></td></tr></table>";

        resp.getWriter().print(out);
        resp.getWriter().close();
    }
    
}
